using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace ExperimentRuleEditor
{
    public class EValue : Form
    {
        private IContainer components;

        private Button btOk;

        private Button btCancel;

        private TextBox tbText;

        public double OperatorValue
        {
            get
            {
                return double.Parse(tbText.Text.ToString());
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && components != null)
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExperimentRuleEditor.EValue));
            this.btOk = new System.Windows.Forms.Button();
            this.btCancel = new System.Windows.Forms.Button();
            this.tbText = new System.Windows.Forms.TextBox();
            base.SuspendLayout();
            this.btOk.AccessibleDescription = null;
            this.btOk.AccessibleName = null;
            resources.ApplyResources(this.btOk, "btOk");
            this.btOk.BackgroundImage = null;
            this.btOk.Font = null;
            this.btOk.Name = "btOk";
            this.btOk.UseVisualStyleBackColor = true;
            this.btOk.Click += new System.EventHandler(btOk_Click);
            this.btCancel.AccessibleDescription = null;
            this.btCancel.AccessibleName = null;
            resources.ApplyResources(this.btCancel, "btCancel");
            this.btCancel.BackgroundImage = null;
            this.btCancel.Font = null;
            this.btCancel.Name = "btCancel";
            this.btCancel.UseVisualStyleBackColor = true;
            this.btCancel.Click += new System.EventHandler(btCancel_Click);
            this.tbText.AccessibleDescription = null;
            this.tbText.AccessibleName = null;
            resources.ApplyResources(this.tbText, "tbText");
            this.tbText.BackgroundImage = null;
            this.tbText.Font = null;
            this.tbText.Name = "tbText";
            base.AccessibleDescription = null;
            base.AccessibleName = null;
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
            resources.ApplyResources(this, "$this");
            this.BackgroundImage = null;
            base.Controls.Add(this.tbText);
            base.Controls.Add(this.btCancel);
            base.Controls.Add(this.btOk);
            this.Font = null;
            base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
            base.Icon = null;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "EValue";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        public EValue(string mValue, string m_Value)
        {
            InitializeComponent();
            if (mValue == null)
            {
                tbText.Text = m_Value;
            }
            else
            {
                tbText.Text = mValue;
            }
            tbText.SelectionStart = 0;
            tbText.SelectionLength = tbText.Text.Length;
            tbText.Select();
            tbText.Refresh();
        }

        private void btOk_Click(object sender, EventArgs e)
        {
            base.DialogResult = DialogResult.OK;
            Close();
        }

        private void btCancel_Click(object sender, EventArgs e)
        {
            base.DialogResult = DialogResult.Cancel;
            Close();
        }
    }
}
